#
# ICD AS (C) 2007 - MAKEFILE CREATED USING CDP MAKEFILE WIZARD
#
# Make sure that the environment variable CDPBase exists. This can
# be carried out by typing echo $CDPBase at the command promt, where
# the Makefile should be run by make. Note that the Makefile Wizard
# is created for the purpose of CDP Projects. It is, however, fully
# possible to use it for other project types as well.
#
# - To add a profiler in your executable, compile and link with, -pg.
# - To open/use shared libs at runtime, compile -rdynamic and link -ldl.
# - Make sure that a valid CDPLicense.key resides in $CDPBase/License.
# - Run CDP executables as root.


ifndef CFG
CFG=Release
endif

ifndef COMPILER
COMPILER=g++
endif

ifeq "$(CFG)" "Release"
CFLAGS= -W -fexceptions -finline-functions -D_LINUX -DNDEBUG -D_THREAD_SAFE -D_LIB -D_MBCS -fpack-struct=4
LIBS= -l
ILFLAGS= -I -I../../dock/oogetopt -I../../ark  -L -L../../dock -L../..
TARGET=
endif

ifeq "$(CFG)" "Debug"
CFLAGS= -W -g -O0 -fexceptions -finline-functions -D_LINUX -D_DEBUG -D_THREAD_SAFE -D_LIB -D_MBCS -fpack-struct=4
LIBS= -loogetopt
ILFLAGS= -I../../scuba -I -I../../ark -I../../dock/oogetopt -I../../backpack/ammo -I../../commando/sapper -I../../dock/oogetopt -I../../ark  -L../../dock -L../../dock/oogetopt -L../..
TARGET=
endif

SOURCE_FILES= 	\
	nuboat.cpp	\
	UBoat.cpp

HEADER_FILES= 	\
	UBoat.h

OBJS=$(patsubst %.cpp, %.o,$(SOURCE_FILES))

.PHONY:all
all: $(TARGET)

$(TARGET): $(OBJS)
	$(COMPILER) $(CFLAGS) $(ILFLAGS) $(GLOBALS) $(OBJS) -o $(TARGET) $(LIBS)

%.o: %.cpp
	$(COMPILER) $(CFLAGS) $(ILFLAGS) $(GLOBALS) -o $@ -c $<

.PHONY:clean
clean:
	 -rm -f $(OBJS) $(TARGET)

